<?php 
namespace Admin\Controller;

use Think\Image;

use Think\Controller;

class ReginsterController extends Controller{
	public function getVerify(){
		if(IS_POST){
			$phone = trim($_POST['phone']);
			if(preg_match("/^13[0-9]{1}[0-9]{8}$|15[0189]{1}[0-9]{8}$|189[0-9]{8}$/",$mobilephone)){    
   		    	//验证通过,先通过短信接口发给用户短信，然后再传验证码给app    
        		$verify = rand(1000, 9999);
        		$this->ajaxReturn(array('result'=>0,'msg'=>'验证码已发送','verify'=>$verify));
			}else{    
    			//手机号码格式不对    
        		$this->ajaxReturn(array('result'=>-1,'msg'=>'手机号码格式不正确'));
			} 
		}
		$this->ajaxReturn(array('result'=>-2,'msg'=>'数据不是以POST方式提交'));
	}
} 
?>